import axios from "axios";

const instance = axios.create({
  timeout: 50000
})

instance.interceptors.request.use(config => {
  return config;
}, err => Promise.reject(err));

instance.interceptors.response.use(res => {
  if (res.status === 200) return Promise.resolve(res.data)
  else return Promise.reject(res)
}, err => Promise.reject(err.message))

export default instance;